#include <iostream>
using namespace std;

const int kMod = 998244353;

int f[70][70][70];

int QuickPow(int a, int b) {
  int ret = 1;

  for (; b; b >>= 1) {
    if (b & 1) {
      ret = (long long)ret * a % kMod;
    }
    a = (long long)a * a % kMod;
  }
  return ret;
}

void Add(int& a, int b, int c) {
  a = (a + (long long)b * c) % kMod;
}

int Solve(long long n) {
  int cnt[3] = {0};
  int pri[3] = {2, 3, 5};

  for (int i = 0; i < 3; i++) {
    for (; n % pri[i] == 0; cnt[i]++) {
      n /= pri[i];
    }
  }
  if (n > 1) {
    return 0;
  }

  int inv5 = QuickPow(5, kMod - 2);

  f[0][0][0] = 6LL * inv5 % kMod;
  for (int i = 0; i <= cnt[0]; i++) {
    for (int j = 0; j <= cnt[1]; j++) {
      for (int k = 0; k <= cnt[2]; k++) {
        Add(f[i + 1][j][k], f[i][j][k], inv5);
        Add(f[i][j + 1][k], f[i][j][k], inv5);
        Add(f[i + 2][j][k], f[i][j][k], inv5);
        Add(f[i][j][k + 1], f[i][j][k], inv5);
        Add(f[i + 1][j + 1][k], f[i][j][k], inv5);
      }
    }
  }
  return (long long)f[cnt[0]][cnt[1]][cnt[2]] * 5LL % kMod * QuickPow(6, kMod - 2) % kMod;
}

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long n;

  cin >> n;
  cout << Solve(n) << "\n";
  return 0;
}